<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>let知识点</title>
</head>
<body>
<ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
</ul>
<script type='text/javascript'>
    //在ES6中使用严格模式
    "use strict"
    //1、变量名和函数名相同
    /*
    let a = 1;
    let a = 2;
    console.log(a)
    */

    //2、变量提升
    /*
    let b = 1;
    function b(){
       console.log(b);
    }
    */

    /*
    let a = 1;
    function fn(){
        console.log(a);//undefined
       // let a = 'zhangjl';
    }

    fn();
    */

    //3、块级作用域
    /*var _li = document.querySelectorAll("li");
    for(var i = 0;i<_li.length;i++){
        _li[i].addEventListener('click',function(){
            console.log(i);
        },false)
    }*/

    {
        var a = 'zhangjl';
        let b = 'zhangs';
    }
    console.log(a);
    console.log(b);
</script>
</body>
</html>